//
// Created by liushuai on 2021/2/21.
//

#include "findComplement.h"
<<<<<<< HEAD:cxx/algorithm/src/findComplement.cc
int findComplement(int num){
    int current = num;
    int count = 0;
    while (current){
        current = current>>1;
        count+=1;
    }
    long long val = std::pow(2,count)-1;
    return val^num;
=======
int findComplement(int num) {
  int current = num;
  int count = 0;
  while (current) {
    current = current >> 1;
    count += 1;
  }
  long long val = std::pow(2, count) - 1;
  return val ^ num;
>>>>>>> dev:cxx/algorithm/common/src/findComplement.cc
}